package com.futureCloudMOM.core.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.futureCloudMOM.core.base.service.impl.BaseServiceImpl;
import com.futureCloudMOM.core.domain.WmsBarCodeTransfer;
import com.futureCloudMOM.core.mapper.WmsBarCodeTransferMapper;
import com.futureCloudMOM.core.service.WmsBarCodeTransferService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 【WMS_BarCodeTransfer】的数据库操作Service实现
 *
 * @author Administrator
 * @since 2023-06-07 09:14:43
 */
@AllArgsConstructor
@Service
public class WmsBarCodeTransferServiceImpl extends BaseServiceImpl<WmsBarCodeTransferMapper, WmsBarCodeTransfer> implements WmsBarCodeTransferService {

    // 条码事务
    private final WmsBarCodeTransferMapper transferMapper;


    @Override
    public void delBarCodeTransferByCode(String BarCode) {
        List<WmsBarCodeTransfer> list = transferMapper.selectList(new LambdaQueryWrapper<WmsBarCodeTransfer>()
                .eq(WmsBarCodeTransfer::getBarCode, BarCode)
                .eq(WmsBarCodeTransfer::getDeleted, "0"));
        list.forEach(transferMapper::deleteById);
    }
}
